<?php /*a:2:{s:60:"E:\leruge\admin\application\admin\view\system\menu_list.html";i:1592151395;s:57:"E:\leruge\admin\application\admin\view\common\__base.html";i:1592135525;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/admin/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="/static/admin/css/public.css" media="all">
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style id="layuimini-bg-color">
    </style>
    
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        
<div>
    <div class="layui-btn-group">
        <button class="layui-btn" id="btn-expand">全部展开</button>
        <button class="layui-btn layui-btn-normal" id="btn-fold">全部折叠</button>
    </div>
    <table id="table" class="layui-table" lay-filter="table"></table>
</div>

<!--显示与隐藏-->
<script id="is_show" type="text/html">
    <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="显示|隐藏" lay-filter="is_show" {{d.is_show ? "checked" : ""}}>
</script>

<!--操作-->
<script id="operation" type="text/html">
    <button class="layui-btn layui-btn-xs" lay-filter="edit">编辑</button>
    <button class="layui-btn layui-btn-xs layui-btn-danger" lay-filter="del">删除</button>
</script>

    </div>
</div>

<script src="/static/admin/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/lay-config.js?v=2.0.0" charset="utf-8"></script>

<script>
    layui.use(['treeTable'], function () {
        let $ = layui.jquery,
            treeTable = layui.treeTable;

        // 树形表格
        let dataTable = treeTable.render({
            elem: "#table",
            tree: {
                iconIndex: 1,
                isPidData: true,
            },
            cols: [[
                {type: "numbers"},
                {title: "菜单名", field: "title"},
                {title: "排序", field: "sort", edit: "text"},
                {title: "显示", toolbar: "#is_show"},
                {title: "操作", toolbar: "#operation"}
            ]],
            url: "<?php echo url('admin/system/menuList'); ?>",
            method: "post",
            parseData: function (res) {
                return {
                    code: res.code,
                    msg: res.msg,
                    data: res.data.list,
                    count: res.data.count
                };
            },
            even: true
        });

        // 全部展开
        $("#btn-expand").click(function () {
            dataTable.expandAll();
            return false;
        });

        // 全部折叠
        $("#btn-fold").click(function () {
            dataTable.foldAll();
            return false;
        });
    });
</script>

</body>
</html>
